#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_GlassUI.h"
#include "Kinect3DData.h"
#include "DlgProgress.h"

class GlassUI : public QMainWindow
{
	Q_OBJECT

public:
	GlassUI(QWidget *parent = Q_NULLPTR);
protected slots:
void on_cmdSure_clicked();
void on_cmdReScan_clicked();
	void on_cmdStart();
	void on_cmdReStart();
	void on_cmdStop();
	void on_cmdNext();
	void DataArrived();
	void CalMeshFinal();
	void StateChange(int state);

	void ProgressChange(float fNewProgressValue, QString strInfo)
	{
		m_dlg.SetText(strInfo);
		m_dlg.SetProgress(fNewProgressValue);
	}
protected:
	int MatToArray(const cv::Mat& matImg, vector<unsigned char>&vData, int& iWidth, int &iHeight);

private:
	Ui::GlassUIClass ui;
	Kinect3DData m_analy;
	DlgProgress m_dlg;
	vector<unsigned char> m_vData;
};
